package com.onlyphoto.onlymall.mvp.view.viewholder

import android.content.Intent
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.onlyphoto.onlymall.R
import com.onlyphoto.onlymall.bean.response.GoodsBean
import com.onlyphoto.onlymall.mvp.view.activity.GoodsListActivity

/**
 * Created by gaochujia on 2019-07-17.
 */
class SubTitleHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
    var subtitle: TextView? = null
    var more: LinearLayout? = null

    init {
        subtitle = itemView.findViewById(R.id.goods_subtitle)
        more = itemView.findViewById(R.id.ll_more)
        more?.setOnClickListener{
            itemView.context.startActivity(Intent(itemView.context, GoodsListActivity::class.java)
                    .putExtra("condition", "1"))
        }
    }

    fun loadData(bean: GoodsBean) {
        subtitle?.text = bean.title
    }
}